<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //1
        Object.prototype.bl=function(){
            for(var pop in this){
                if(this.hasOwnProperty(pop)){
                    console.log(pop+':'+this[pop])
                }
            }
        }
        let a={
            name:"龙龟",
            age:18,
            sex:"男"
        }
        a.bl();
        //2
        Date.prototype.times=function(){
            var nian=this.getFullYear();
            var yue=('0'+(this.getMonth()+1)).slice(-2);
            // var month = ('0' + (this.getMonth() + 1)).slice(-2);
            var r=('0'+(this.getDate())).slice(-2);
            console.log(nian+"年"+yue+"月"+r+"日");
        }
        var Datetime=new Date();
        Datetime.times();

        
    </script>
</body>
</html>